package com.apes.framework.util.monitor.threadPool;

import com.apes.framework.util.DateUtil;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@Document(indexName = "logs-threadpool", replicas = 0)
public class ThreadPoolStatValue {

    @Id
    private String id;

    protected int maxPoolSize;
    protected int corePoolSize;
    protected int poolSize;
    protected int queue;
    protected long tasks;
    protected long completed;
    protected long active;
    protected boolean shutdown;
    protected boolean terminated;


    /**
     * ip
     **/
    private String ip;

    /**
     * 创建时间
     **/
    @Field(type = FieldType.Date)
    private String createdOn = DateUtil.format("yyyy-MM-dd'T'HH:mm:ss.SSS") + "+0800";

    /**
     * 更新时间
     **/
    @Field(type = FieldType.Date)
    private String endedOn = DateUtil.format("yyyy-MM-dd'T'HH:mm:ss.SSS") + "+0800";
}
